import {
  request
} from '../utils/request';

// 图片直播列表
const imageLiveList = (pageNum, pageSize) => {
  return request({
    url: '/liveRoomImg/list',
    data: {
      pageNum: pageNum,
      pageSize: pageSize
    }
  });
}

// 图片直播详情
const imageLiveDetails = (liveId) => {
  return request({
    url: `/liveRoomImg/${liveId}`
  });
}

// 图片直播图片列表
const imageLiveImages = (liveId, data = {}) => {
  return request({
    url: `/liveRoomImg/img/${liveId}`,
    data: data
  });
}

// 图片直播评论列表
const imageLiveComment = (liveId, pageNum, pageSize) => {
  return request({
    url: `/liveRoomImg/comment/${liveId}`,
    data: {
      pageNum: pageNum,
      pageSize: pageSize
    }
  });
}

// 发送评论
const sendComment = (liveId, comment) => {
  return request({
    url: '/liveRoomImg/comment/add',
    method: 'POST',
    data: {
      liveId: liveId,
      comment: comment
    }
  });
}

// 点赞直播
const likeLive = (liveId) => {
  return request({
    url: `/liveRoomImg/like/${liveId}`
  });
}

// 退出直播
const signOutLive = (liveId) => {
  return request({
    url: `/liveRoomImg/out/${liveId}`
  });
}

// 点赞评论
const likeComment = (commentId) => {
  return request({
    url: `/liveRoomImg/comment/like/${commentId}`
  });
}

// 视频直播列表
const videoLiveList = (pageNum, pageSize) => {
  return request({
    url: '/liveRoom/list',
    data: {
      pageNum: pageNum,
      pageSize: pageSize
    }
  });
}

// 视频直播详情
const videoLiveDetails = (roomId) => {
  return request({
    url: `/liveRoom/${roomId}`
  });
}

module.exports = {
  imageLiveList,
  imageLiveDetails,
  imageLiveImages,
  imageLiveComment,
  sendComment,
  likeLive,
  signOutLive,
  likeComment,
  videoLiveList,
  videoLiveDetails
}